<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Like
 * @copyright  Copyright Hire-Experts LLC
 * @license    http://www.hire-experts.com
 * @version    $Id: index.tpl 2010-09-07 17:53 idris $
 * @author     Idris
 */
?>

<?php $this->headScript()->appendFile('application/modules/Like/externals/scripts/core.js'); ?>

<script type="text/javascript">
like.url.remove = '<?php echo $this->url(array('action' => 'unlike'), 'like_default'); ?>';
like.clubs.users.count = <?php echo $this->users ? $this->users->getTotalItemCount() : 0; ?>;
like.clubs.pages.count = <?php echo $this->pages ? $this->pages->getTotalItemCount() : 0; ?>;

window.addEvent('domready', function(){
	like.init_counts();
});
</script>

<h2><?php echo $this->translate("Like Information"); ?></h2>
<p>
  <?php echo $this->translate("On this page you can find like clubs you are involved."); ?>
</p>
<br />
<div>

<div class="like_profile_navigation">
<?php echo $this->navigation()->menu()->setContainer($this->navigation)->setPartial(array('_navigation.tpl', 'like'))->render(); ?>
</div>

<div class="like_container">

<?php if ($this->users || $this->pages): ?>

<?php if ($this->users): ?>
	<div id="like_club_users_container" class="like_club_container">
	<?php foreach($this->users as $user): ?>
	  <div class="item" id="like_<?php echo $user->getGuid(); ?>">
	    <div class="l">
	      <?php echo $this->htmlLink( $user->getHref(), $this->itemPhoto($user, 'thumb.icon') ); ?>
	    </div>
	    <div class="r">
	      <?php echo $this->htmlLink( $user->getHref(), substr($user->getTitle(), 0, 20), array('class' => 'bold') ); ?>
	    </div>
	    <div class="op">
	      <?php echo $this->htmlLink("javascript:like.remove('{$user->getType()}', {$user->getIdentity()})", '', array('class' => 'remove_like_link')); ?>
	    </div>
	    <div class="clr"></div>
	  </div>
	<?php endforeach; ?>
  <div class="no_result_users tip hidden"><span><?php echo $this->translate("There is no like clubs."); ?></span></div>
	<div class="clr"></div>
	</div>
<?php endif; ?>

<?php if ($this->pages): ?>
	<div id="like_club_pages_container" class="like_club_container hidden">
	<?php foreach($this->pages as $page): ?>
	  <div class="item" id="like_<?php echo $page->getGuid(); ?>">
	    <div class="l">
	      <?php echo $this->htmlLink( $page->getHref(), $this->itemPhoto($page, 'thumb.icon') ); ?>
	    </div>
	    <div class="r">
	      <?php echo $this->htmlLink( $page->getHref(), substr($page->getTitle(), 0, 20), array('class' => 'bold') ); ?>
	    </div>
	    <div class="op">
	      <?php echo $this->htmlLink("javascript:like.remove('{$page->getType()}', {$page->getIdentity()})", '', array('class' => 'remove_like_link')); ?>
	    </div>
	    <div class="clr"></div>
	  </div>
	<?php endforeach; ?>
	<div class="no_result_pages tip hidden"><span><?php echo $this->translate("There is no like clubs."); ?></span></div>
	<div class="clr"></div>
	</div>
<?php endif; ?>

<?php else: ?>

  <div class="no_result_pages tip hidden"><span><?php echo $this->translate("You did not like anything yet."); ?></span></div>

<?php endif; ?>

</div>

<div class="clr"></div>

</div>